//
//  MyDetailOrderTableViewCell.swift
//  OnceNectar
//
//  Created by 法正磊 on 2018/2/25.
//  Copyright © 2018年 com.inwhoop. All rights reserved.
//

import UIKit

class MyDetailOrderTableViewCell: UITableViewCell {

    @IBOutlet weak var mainView: UIView!
    @IBOutlet weak var orderNumberLabel: UILabel!
    @IBOutlet weak var urgeButton: UIButton!
    @IBOutlet weak var itemImageView: UIImageView!
    @IBOutlet weak var nameLabel: UILabel!
    @IBOutlet weak var priceLabel: UILabel!
    @IBOutlet weak var priceCenterYWithName: NSLayoutConstraint!
    @IBOutlet weak var priceCenterYWithSpec: NSLayoutConstraint!
    @IBOutlet weak var specificationsLabel: UILabel!
    @IBOutlet weak var statusLabel: UILabel!
    override func awakeFromNib() {
        super.awakeFromNib()
        setUI()
        // Initialization code
    }
    
    func setUI() {
        urgeButton.layer.cornerRadius = urgeButton.height / 2
        urgeButton.layer.borderColor = ONColor.currencyRedColor.cgColor
        urgeButton.layer.borderWidth = 1
    }
    
    func showData(orderDetailType: OrderDetailType) {
        urgeButton.isHidden = orderDetailType != .waitPay
        if orderDetailType != .waitOut {
            
            statusLabel.isHidden = true
            priceCenterYWithName.priority = .defaultLow
            priceCenterYWithSpec.priority = .defaultHigh
        }
    }
    
    @IBAction func urgeTap(_ sender: UIButton) {
          CustomShowAlertView().show(title: "小蜜已收到你的请求，正在为您抓紧处理！还请稍安勿躁~", tapClosure: {})
    }
    
    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
